package com.javathread.th5.bq;

import java.util.concurrent.Delayed;
import java.util.concurrent.TimeUnit;

/**
 * 类说明: 存放到队列的元素
 * @author Administrator
 *
 */
public class ItemVo<T> implements Delayed {
	
	private long activeTime;//到期时间  单位毫秒
	
	private T date;
	
	public ItemVo(long activeTime, T date) {
		super();
		//将传入的时长转换为超时的时刻
		this.activeTime = TimeUnit.NANOSECONDS.convert(activeTime, TimeUnit.MILLISECONDS) + System.nanoTime();
		this.date = date;
	}
	

	@Override
	public int compareTo(Delayed o) {
		return 0;
	}

	@Override
	public long getDelay(TimeUnit unit) {
		return 0;
	}

}
